home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-12-18 | 1.3 KB | 62 lines | [TEXT/MPS ] |
- #include <Types.h>
- #include <QuickDraw.h>
- #include <Fonts.h>
- #include <Events.h>
- #include <OSEvents.h>
- #include <Controls.h>
- #include <Windows.h>
- #include <Menus.h>
- #include <TextEdit.h>
- #include <Dialogs.h>
- #include <Desk.h>
- #include <Scrap.h>
- #include <ToolUtils.h>
- #include <Memory.h>
- #include <SegLoad.h>
- #include <Files.h>
- #include <OSUtils.h>
- #include <Traps.h>
- #include <StdLib.h>
-
- #include "TDocument.h"
- #include "TApplication.h"
- #include "MacTutorDoc.h"
-
- // create and delete document windows
-
- // we pass the resID parameter up to our base class,
- // which actually creates the window for us
- TMacTutorDocument::TMacTutorDocument(short resID, StringPtr s) : (resID)
- {
- SetDisplayString(s);
- ShowWindow(fDocWindow); // Make sure the window is visible
- }
-
- TMacTutorDocument::~TMacTutorDocument(void)
- {
- HideWindow(fDocWindow);
- }
-
- void TMacTutorDocument::DoUpdate(void)
- {
- BeginUpdate(fDocWindow); // this sets up the visRgn
- if ( ! EmptyRgn(fDocWindow->visRgn) ) // draw if updating needs to be done
- {
- DrawWindow();
- }
- EndUpdate(fDocWindow);
- }
-
- // Draw the contents of an application window.
-
- void TMacTutorDocument::DrawWindow(void)
- {
- SetPort(fDocWindow);
- EraseRect(&fDocWindow->portRect);
-
- MoveTo(100,100);
- TextSize(18); TextFont(monaco);
- DrawString(fDisplayString);
-
- } // DrawWindow
-